{extend name="$base_mall" /}
{block name="resources"}
<link rel="stylesheet" type="text/css" href="WAP_CSS/member_index.css">
<style>
	.operation-wrapper {
		background-color: white;
	}
	.operation-item {
		display: flex;
		height: 54px;
	}
	.icon-wrapper {
		flex: 0 0 50px;
	}
	.s-center {
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.text-wrapper {
		flex: 1;
	}
	.arrow-right {
		flex: 0 0 50px;
	}
	.operation-text {
		width: 100%;
	}
	.member-head {
		background-image: url('template/mall/default/public/img/member/memberbg.png');/* 引入图片 */
		background-size: 100% 100%;/* 设置图片的大小 */
		background-repeat: no-repeat;/* 如果图片比较小,框比他大的时候,设置的显示方式,repeat-x沿x轴显示,repeat-y沿y轴显示 */
		background-position: 50% 50%;

	}
	.order-text {
		margin-top: 24px;
	}
	.member-myaccount-wrapper{
		flex-wrap: wrap;
		padding: 0 4px;
	}
	.myaccount {
		display: flex;
	}
	.myaccount li {
		flex: 1;
		list-style: none;
	}
	.account-div {
		height: 100%;
		background-color: #FFF2DF;
		box-sizing: border-box;
		border-radius: 5px;
		margin: 0 5px;
		padding: 10px 0px;
		text-align: center;
		border:  1px solid #FF861B;
	}
	.account-text{
		color: #644832;
		font-weight: 800;
	}
	.account-num{
		color: #644832;
		margin-top: 5px;
		font-size: 12px;
		font-weight: 800;
	}

	.member-info .member-level {
		color: #FFFFFF !important;
		border-color: #FFFFFF !important;
		border-radius: 0px!important;
	}

	.operation-item {
		border-bottom: 1px solid #f2f2f2;
	}

	.order-icon img {
	width: 80% !important;
	}
</style>
{/block}
{block name="head" }{/block}
{block name="main" }
{php}
$member_detail 	   = api('System.Member.memberInfo');
$member_info  	   = $member_detail['data'];

// 会员账户信息
$member_account = api("System.Member.memberAccount");
$member_account = $member_account['data'];

// 会员等级信息
$member_level = api("System.Member.memberLevel", ['level_id' => $member_info['member_level']]);
$member_level = $member_level['data'];

$member_min_level = api("System.Member.memberMinLevel", ['level_id' => $member_info['member_min_level']]);
$member_min_level = $member_min_level['data'];

// 累计佣金
$member_all_salary = api("System.Member.memberAllSalary");
$member_all_salary = $member_all_salary['data'];

//待审核金额
$member_withdraw_account = api("System.Member.withdrawAccount");
$member_withdraw_account = $member_withdraw_account['data'];

if(addon_is_exit('NsMemberSign')){
$isSign = api("NsMemberSign.MemberSign.isSignIn");
$isSign = $isSign['data'];
}

$coupon_count = api("System.Member.couponNum");
$coupon_count = $coupon_count['data'];

$wapEntrance = api("System.Config.mallEntrance");
$wapEntrance = $wapEntrance['data'];


$discounts_adv = api('System.Shop.advDetail', ['ap_keyword' => 'WAP_MEMBER', 'export_type' => 'data']);

{/php}
<div >
	<div class="member-head ns-bg-color" >
		<div class="member-edit">
			<a href="{:__URL('MALL_MAIN/member/info')}"><img src="WAP_IMG/member/member-icon-edit.png"></a>
		</div>
		<div class="member-head-top" style="padding-bottom: 30px;position: relative">
			<div class="member-headimg ns-border-color-gray">
				{if condition="$member_info['user_info']['user_headimg'] eq ''"}
				<img src="{:__IMG($default_headimg)}" />
				{else/}
				<img src="{:__IMG($member_info['user_info']['user_headimg'])}"/>
				{/if}
			</div>
			<div class="member-info">
				<div class="member-name">
					{$member_info["user_info"]['nick_name']}
					{if $member_min_level['min_level_name']}
					<span style="background-color: #5DA0FF;font-size: 12px;padding: 4px;border-radius: 4px;">{$member_min_level['min_level_name']}</span>
					{/if}
				</div>
				{if $member_level['level_name']}
				<div class="member-level">{$member_level['level_name']}</div>
				{/if}
			</div>
			<div class="clear"></div>
		</div>

	</div>

	<div class="member-myaccount-wrapper">
		<div class="myaccount">
			<li>
				<a href="{:__URL('MALL_MAIN/member/balance')}">
				<div class="account-div">
					<div class="account-text">{:lang('member_balance')}</div>
					<div class="account-num">{$member_account['balance']}</div>
				</div>
				</a>
			</li>
			<li>
				<a href="{:__URL('MALL_MAIN/member/salary')}">
					<div class="account-div">
						<div class="account-text">{:lang('member_salary')}</div>
						<div class="account-num">{$member_account['salary']}</div>
					</div>
				</a>
			</li>
			<li>
				<a href="{:__URL('MALL_MAIN/member/point')}">
				<div class="account-div">
					<div class="account-text">{:lang('member_integral')}</div>
					<div class="account-num">{$member_account['point']}</div>
				</div>
				</a>
			</li>

			<li style="display: none">
				<a href="{:__URL('MALL_MAIN/member/coin')}">
				<div class="account-div">
					<div class="account-text">{:lang('member_coin')}</div>
					<div class="account-num">{$member_account['coin']}</div>
				</div>
				</a>
			</li>

		</div>
	</div>

	<div class="member-order top-lef radius-wrapper">
	 	<div class="member-order-head ns-border-color-gray-fadeout-50">
	 		<a href="{:__URL('MALL_MAIN/order/lists')}">
	 		<div class="ns-text-color-black order-head-left"><span style="width: 10px;height: 100px;background-color: #df8f0e;color: #FF4F2E;border-radius: 3px;margin-right: 5px">&nbsp;&nbsp;</span>全部订单</div>
	 		<div class="order-head-right ns-text-color-gray">查看全部<i class="fa fa-angle-right ns-text-color-gray"></i></div>
	 		</a>
	 		<div class="clear"></div>
	 	</div>
	 	<div class="member-order-list">
	 		{php}
				$order_status_num = api("System.Order.orderCount",['order_status' => 0,'point' => 1]);
				$wait_pay = $order_status_num['data'];
	 		{/php}
	 		<a href="{:__URL('MALL_MAIN/order/lists?status=0')}">
			 	<div class="member-order-item ns-border-color-gray-fadeout-50">
			 		{if $wait_pay > 99}
			 			<div class="order-num ns-bg-color">99+</div>
					{elseif $wait_pay > 0}
				 		<div class="order-num ns-bg-color">{$wait_pay}</div>
					{/if}
			 		<div class="order-icon"><img src="WAP_IMG/member/order-icon-0_new.png"></div>
			 		<div class="order-text">{:lang('member_pending_payment')}</div>
		 		</div>
	 		</a>

	 		{php}
				$order_status_num = api("System.Order.orderCount",['order_status' => 1,'point' => 1]);
				$wait_delivery = $order_status_num['data'];
	 		{/php}
	 		<a href="{:__URL('MALL_MAIN/order/lists?status=1')}">
			 	<div class="member-order-item ns-border-color-gray-fadeout-50">
			 		{if $wait_delivery > 99}
				 		<div class="order-num ns-bg-color">99+</div>
			        {elseif $wait_delivery > 0}
				 		<div class="order-num ns-bg-color">{$wait_delivery}</div>
			        {/if}
			 		<div class="order-icon"><img src="WAP_IMG/member/order-icon-1_new.png"></div>
			 		<div class="order-text">{:lang('member_shipment_pending')}</div>
		 		</div>
	 		</a>

	 		{php}
				$order_status_num = api("System.Order.orderCount",['order_status' => 2,'point' => 1]);
				$wait_recieved = $order_status_num['data'];
	 		{/php}
	 		<a href="{:__URL('MALL_MAIN/order/lists?status=2')}">
			 	<div class="member-order-item ns-border-color-gray-fadeout-50">
			 		{if $wait_recieved > 99}
			 		<div class="order-num ns-bg-color">99+</div>
			        {elseif $wait_recieved > 0}
			 		<div class="order-num ns-bg-color">{$wait_recieved}</div>
			        {/if}
			 		<div class="order-icon"><img src="WAP_IMG/member/order-icon-2_new.png"></div>
			 		<div class="order-text">{:lang('member_goods_received')}</div>
		 		</div>
	 		</a>

			{php}
			$order_status_num = api("System.Order.orderCount",['order_status' => 3,'point' => 1]);
			$wait_recieved = $order_status_num['data'];
			{/php}
			<a href="{:__URL('MALL_MAIN/order/lists?status=3')}">
				<div class="member-order-item ns-border-color-gray-fadeout-50">
					{if $wait_recieved > 99}
					<div class="order-num ns-bg-color">99+</div>
					{elseif $wait_recieved > 0}
					<div class="order-num ns-bg-color">{$wait_recieved}</div>
					{/if}
					<div class="order-icon"><img src="WAP_IMG/member/order-icon-3_new.png"></div>
					<div class="order-text">{:lang('member_received_goods')}</div>
				</div>
			</a>

	 		{php}
				$order_status_num = api("System.Order.orderCount",['order_status' => -1,'point' => 1]);
				$refunding = $order_status_num['data'];
	 		{/php}
	 		<a href="{:__URL('MALL_MAIN/order/lists?status=-1')}">
			 	<div class="member-order-item ns-border-color-gray-fadeout-50">
			 		{if $refunding > 99}
			 		<div class="order-num ns-bg-color">99+</div>
			        {elseif $refunding > 0}
			 		<div class="order-num ns-bg-color">{$refunding}</div>
			        {/if}
			 		<div class="order-icon"><img src="WAP_IMG/member/order-icon-4_new.png"></div>
			 		<div class="order-text">{:lang('refund_after_sale')}</div>
		 		</div>
	 		</a>
	 		<div class="clear"></div>
	 	</div>
	</div>

	<div class="operation-wrapper radius-wrapper"  style="padding: 0 5px">
		{notempty name="$wapEntrance"}
		{foreach name="$wapEntrance" item="vo"}
		{if is_url($vo.url)}
		<a href="{$vo.url}">
			{else/}
			<a href="{:__URL('MALL_MAIN' . $vo.url)}">
				{/if}
				<div class="operation-item">
					<div class="icon-wrapper s-center">
						<div class="operation-img s-center">
							<img src="{:__IMG($vo.icon)}" style="height: 24px"/>
						</div>
					</div>
					<div class="text-wrapper s-center">
						<div class="operation-text">{$vo.title}</div>
					</div>
					<div class="arrow-right s-center">
						<i class="fa fa-angle-right ns-text-color-gray"></i>
					</div>
				</div>
			</a>
			{/foreach}
			{/notempty}
	</div>
	<div style="height: 30px"></div>
</div>
<script>
function nfxPromoterLock(obj,islock){
	if(islock == 1){
		toast("该账户被冻结");
	}
}
</script>
{/block}